home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-11-10 | 2.8 KB | 106 lines | [TEXT/GEOL] |
- Item forwarded by A33 to A34
-
- Item 2613646 8-Nov-89 19:42
-
- From: D2086 Efficient Field Svc, C Faith,PRT
-
- To: D1950 CSG, Don Phillips,PRT
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: RE: TGridView Dim Hilighting
-
- George,
-
- It was not real clear to me what you are trying to do.
-
- I assume that you are talking about 2 different windows, a window with the list
- to be highlighted and a Find window.
-
- In TView.Activate the hlDesired is set to hlDim when a window is deactivated.
-
- TGridView.HighlightCells has this:
-
- IF fromHL = hlDim THEN { GridViews don't support dim highlighting }
- fromHL := hlOFF;
- IF toHL = hlDim THEN
- toHL := hlOFF;
-
- IF (fromHL <> toHL) & Focus THEN
- BEGIN
- CellsToPixels(theCells, pPixelsToHighlight);
-
- PenNormal;
- UseSelectionColor;
- InvertRgn(pPixelsToHighlight); { highlight the cells }
- END;
-
- So the net effect is that highlights are disabled when TViews are deactivated.
-
- There are several things that you could do:
-
- 1) OVERRIDE TTextListView.Activate to set the hlDesired to hlOn instead of
- hlDim. This is probably nonStandard interface stuff.
-
- 2) OVERRIDE TTextListView.HighLighCells to support Dim highlighting. This
- seems to work pretty well but I have not tested it very thoroughly:
-
- PROCEDURE TMyGridView.HighlightCells(theCells: RgnHandle; fromHL, toHL:
- HLState); OVERRIDE;
-
- PROCEDURE DoDrawCell(aCell: GridCell);
- VAR
- aRect: VRect;
- aQDRect:Rect;
-
- BEGIN
- CellToVRect(aCell,aRect);
- ViewToQDRect(aRect,aQDRect);
- InsetRect(aQDRect,fColInset,fRowInset);
- DrawCell(aCell,aQDRect);
- END;
-
- BEGIN
- IF (fromHL = hlON) AND (toHL = hlDim) & Focus THEN { GridViews don't
- support dim highlighting }
- BEGIN
- CellsToPixels(theCells, pPixelsToHighlight);
-
- PenPat(gray);
- PenMode(patBic);
- PaintRgn(pPixelsToHighlight); { dim or re-Highlight the cells }
- END
- ELSE IF (fromHL = hlDim) AND (toHL = hlON) & Focus THEN
- BEGIN
- CellsToPixels(theCells, pPixelsToHighlight);
- PenPat(white);
- PenMode(patCopy);
- PaintRgn(pPixelsToHighlight); { blank out the cells }
-
-
- EachSelectedCellDo(DoDrawCell); { redraw the cells }
-
- PenNormal;
- UseSelectionColor;
- InvertRgn(pPixelsToHighlight); { highlight the cells }
- END
- ELSE IF (fromHL <> toHL) & Focus THEN
- BEGIN
- CellsToPixels(theCells, pPixelsToHighlight);
-
- PenNormal;
- UseSelectionColor;
- InvertRgn(pPixelsToHighlight); { highlight the cells }
- END;
- END;
-
- This should have the correct effect, it seems to work well with both color and
- monochrome monitors. Dim highlighting would only take place via activate as no
- other methods det the hlDesired.
-
- I hope this helps!
-
- - Curtis Faith
-
-
-